{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 142,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.750363Z",
     "start_time": "2023-12-20T13:11:00.721968Z"
    }
   },
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import random\n",
    "import re\n",
    "import math\n",
    "from PIL import Image\n",
    "from openpyxl.drawing.image import Image\n",
    "from openpyxl.drawing.spreadsheet_drawing import AnchorMarker, OneCellAnchor\n",
    "from openpyxl.drawing.xdr import XDRPositiveSize2D\n",
    "from openpyxl.styles import Font, Alignment\n",
    "from openpyxl.utils.units import pixels_to_EMU\n",
    "import copy\n",
    "import openpyxl\n",
    "from openpyxl.utils import column_index_from_string as Col2Int\n",
    "from concurrent.futures import ThreadPoolExecutor\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 143,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.750567Z",
     "start_time": "2023-12-20T13:11:00.727617Z"
    }
   },
   "outputs": [],
   "source": [
    "def judge_part(items, part):\n",
    "    pattern = '|'.join(str(x) for x in items)\n",
    "    if len(re.findall(pattern, part)) > 0:\n",
    "        return True\n",
    "    else:\n",
    "        return False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 144,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.757606Z",
     "start_time": "2023-12-20T13:11:00.732892Z"
    }
   },
   "outputs": [],
   "source": [
    "class ProjectInformationBase:\n",
    "\n",
    "    # 基础信息\n",
    "    def __init__(self) -> None:\n",
    "        self.config = {\n",
    "            '项目名称': '武义桃花源房地产开发项目 （二期）--二标段 ',\n",
    "            '单位工程': '',\n",
    "            '分部工程': '主体结构',\n",
    "            '项目负责人': '李凤山',\n",
    "            '施工单位': '海天建设集团有限公司',\n",
    "            '监理单位': '浙江万基工程管理有限公司',\n",
    "            '分包单位': '/',\n",
    "            '分包单位项目负责人': '/',\n",
    "            '检验批部位': 'D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯',\n",
    "            '常规': True\n",
    "        }\n",
    "\n",
    "        self.muban_config = {\n",
    "            '后浇带': 15,\n",
    "            '梁': 13,\n",
    "            '板': 23,\n",
    "            '柱': 13,\n",
    "            '墙': 14,\n",
    "            '楼梯': 3,\n",
    "            '预制构件': 24,\n",
    "            '其他': 0\n",
    "        }\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 145,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.757870Z",
     "start_time": "2023-12-20T13:11:00.744894Z"
    }
   },
   "outputs": [],
   "source": [
    "class ProjectInformationWood(ProjectInformationBase):\n",
    "    # 模板数据的格式的整理和梳理\n",
    "    config_item = ['后浇带', '梁', '板', '柱', '墙', '楼梯', '预制构件']\n",
    "    config_unit = {'后浇带': '处', '梁': '件', '板': '间', '柱': '件', '墙': '间', '楼梯': '跑', '预制构件': '件'}\n",
    "\n",
    "    def __init__(self):\n",
    "        super().__init__()\n",
    "\n",
    "        self.check_number_func = {\n",
    "\n",
    "            '梁检查数量': math.ceil(self.muban_config['梁'] / 10),\n",
    "            '板检查数量': math.ceil(self.muban_config['板'] / 10),\n",
    "            '柱检查数量': math.ceil(self.muban_config['柱'] / 10),\n",
    "            '墙检查数量': math.ceil(self.muban_config['墙'] / 10),\n",
    "            '楼梯检查数量': self.muban_config['楼梯'],\n",
    "            '预制构件检查数量': math.ceil(self.muban_config['墙'] / 10),\n",
    "            '后浇带检查数量': self.muban_config['后浇带'],\n",
    "        }\n",
    "\n",
    "        self.check_number_func['构件总数'] = sum(list(self.check_number_func.values()))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 146,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.766527Z",
     "start_time": "2023-12-20T13:11:00.747689Z"
    }
   },
   "outputs": [],
   "source": [
    "class ProjectInFoErrorRelex(object):\n",
    "\n",
    "    # 错误处理的类\n",
    "\n",
    "    def __init__(self, number: int, OldRange: list[int], accuracy=90):\n",
    "        \"\"\"\n",
    "\n",
    "        @param number: 需要检查的数量\n",
    "        @param OldRange: 检查的氛围\n",
    "        @param accuracy: 正确率\n",
    "        \"\"\"\n",
    "\n",
    "        self.true_numer = None\n",
    "        self.error_name = None\n",
    "        self.DateFrame = None\n",
    "        self.number = number\n",
    "\n",
    "        self.OldRange = OldRange\n",
    "        self.accuracy = accuracy\n",
    "        self.rowdata = {}\n",
    "        self.run()\n",
    "\n",
    "    def run(self):\n",
    "        ##1、获取正确和错误的个数\n",
    "        self.true_numer, self.error_name = self.True_and_error(self.number)\n",
    "        list1 = [self.error_number(self.OldRange) for _ in range(self.error_name)]  # 根据错误的数据范围生成数据\n",
    "        list2 = [random.randint(*self.OldRange) for _ in range(self.true_numer)]\n",
    "        list3 = list(list1 + list2)\n",
    "        # 2、生成序号\n",
    "        numbers = [x for x in range(int(len(list3)))]\n",
    "        random.shuffle(numbers)\n",
    "        self.DateFrame = pd.DataFrame({'位置': numbers, '数据': list3})\n",
    "        if self.error_name == 0:\n",
    "            self.rowdata['错误数据所在的位置'] = 0\n",
    "        else:\n",
    "            self.rowdata['错误数据所在的位置'] = self.DateFrame['位置'].iloc[:self.error_name].to_list()  # 错误数据所在的位置\n",
    "\n",
    "        self.rowdata['数据'] = self.DateFrame.sort_values(by=['位置'])['数据'].to_list()\n",
    "\n",
    "        if self.rowdata['错误数据所在的位置'] != 0:\n",
    "            for value in self.rowdata['错误数据所在的位置']:\n",
    "                if self.OldRange[0] <= self.rowdata['数据'][value] <= self.OldRange[1]:\n",
    "                    self.rowdata['错误数据所在的位置'].remove(value)\n",
    "\n",
    "        # print(self.rowdata)\n",
    "\n",
    "    def error_number(self, size):\n",
    "\n",
    "        new_size = {}\n",
    "        args = random.randint(65, 100) / 100\n",
    "        if size[0] < 0:\n",
    "\n",
    "            new_size[0] = int(size[0] / args)\n",
    "        else:\n",
    "            new_size[0] = int(size[0] * args)\n",
    "\n",
    "        if size[1] < 0:\n",
    "\n",
    "            new_size[1] = int(size[1] * args)\n",
    "        else:\n",
    "            new_size[1] = int(size[1] * (1 + args))\n",
    "\n",
    "        size = {\n",
    "            '下限生成': [new_size[0], size[0]],\n",
    "            '上限生成': [size[1], new_size[1]]\n",
    "        }\n",
    "        if self.OldRange[0] == 0 or self.OldRange[1] == 0:\n",
    "            if self.OldRange[0] == 0:\n",
    "                return random.randint(*size['上限生成'])\n",
    "\n",
    "            if self.OldRange[1] == 1:\n",
    "                return random.randint(*size['下限生成'])\n",
    "\n",
    "        if random.random() > 0.5:\n",
    "\n",
    "            return random.randint(*size['下限生成'])\n",
    "        else:\n",
    "            return random.randint(*size['上限生成'])\n",
    "\n",
    "    @staticmethod\n",
    "    def __inquire__image__(sheet, imagepath=None, imagesheape=None,\n",
    "                           row=None, col=None, rowOff=0, colOff=60000):\n",
    "        \"\"\"把图片插入到excel文件中的指定位置\n",
    "        插入到指定单元格然后向右偏移一点距离，目的是不让图片的边框和单元格的边框重合\n",
    "        :param sheet:工作表名称\n",
    "        :param row：起始单元格行号\n",
    "        :param col:起始单元格列号\n",
    "        :param rowOff：行偏移距离（10000为单位）\n",
    "        :param colOff：列偏移距离（10000为单位）\n",
    "        :return:\n",
    "        \"\"\"\n",
    "        if imagepath is None:\n",
    "            from urls import TEMPLATES\n",
    "            imagepath = TEMPLATES['static']['error_image']\n",
    "        if imagesheape is None:\n",
    "            imagesheape = [25, 25]\n",
    "        if rowOff is None:\n",
    "            rowOff = 0\n",
    "        if colOff is None:\n",
    "            colOff = 60000\n",
    "\n",
    "        img = Image(imagepath)\n",
    "        # 设置图片的宽和高\n",
    "        img.width, img.height = imagesheape\n",
    "\n",
    "        def offset_img(img, row, col, rowOff, colOff):\n",
    "            \"\"\"精确设置图片位置，偏移量以万为单位进行微调吧，具体计算公式太麻烦了\n",
    "            row column 的索引都是从0开始的,我这里要把图片插入到单元格B10\n",
    "            \"\"\"\n",
    "            p2e = pixels_to_EMU\n",
    "            h, w = img.height, img.width\n",
    "            size = XDRPositiveSize2D(p2e(w), p2e(h))\n",
    "            marker = AnchorMarker(\n",
    "                col=col - 1,\n",
    "                colOff=colOff,\n",
    "                row=row - 1,\n",
    "                rowOff=rowOff)\n",
    "            img.anchor = OneCellAnchor(_from=marker, ext=size)\n",
    "\n",
    "            offset_img(img, row, col, rowOff, colOff)\n",
    "            # 将图片添加到excel中\n",
    "            sheet.add_image(img)\n",
    "            print('图片插入成功')\n",
    "\n",
    "    def True_and_error(self, number):\n",
    "\n",
    "        bili = random.randint(self.accuracy, 100) / 100\n",
    "        if number <= 3:\n",
    "            true_numer = 3\n",
    "            error_name = 0\n",
    "            return [true_numer, error_name]\n",
    "        true_numer = int(random.randint(int(number * bili), number))  # 正确的个数\n",
    "\n",
    "        error_name = int(number - true_numer)  # 错误的个数\n",
    "\n",
    "        return [true_numer, error_name]\n",
    "\n",
    "    def __str__(self):\n",
    "\n",
    "        return (f'正确的个数{self.true_numer};'\n",
    "                f'错误的个数{self.error_name};'\n",
    "                f'正确的数据{self.rowdata[\"数据\"]};'\n",
    "                f'范围{self.OldRange};'\n",
    "                f'错误数据所在的位置{self.rowdata[\"错误数据所在的位置\"]};')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.774619Z",
     "start_time": "2023-12-20T13:11:00.768738Z"
    }
   },
   "outputs": [],
   "source": [
    "class MuBan(object):\n",
    "\n",
    "    def __init__(self,\n",
    "                 Dataframe: pd.DataFrame, passage: int, max_pasge: int = 3):\n",
    "        \"\"\"\n",
    "\n",
    "        @param excel_path2: 路径\n",
    "        @param Dataframe: 【内容,[页码,行号,列号]】\n",
    "        @param passage:需要处理的页码\n",
    "        \"\"\"\n",
    "        excel_path2 = r'/Users/chenhongbin/Desktop/工作过程中需要用到的程序/myapp2/myapp2/Templates/模板/模板安装检验批质量验收记录.xlsx'\n",
    "        self.Dataframe = Dataframe\n",
    "        self.max_pasge = max_pasge\n",
    "        self.passage = passage\n",
    "        self.WorkBook = openpyxl.load_workbook(excel_path2)\n",
    "        self.sheet = self.WorkBook[self.WorkBook.sheetnames[self.passage]]  # 这里就是页码\n",
    "\n",
    "        self.all_sheet_names = []\n",
    "        self.main()\n",
    "        self.WorkBook.save('./ssdasdaww1sadsa11.xlsx')\n",
    "        print('完成')\n",
    "        self.WorkBook.close()\n",
    "\n",
    "    def main(self):\n",
    "        print('最大页数', self.max_pasge)\n",
    "        for x in range(self.max_pasge):\n",
    "            new_sheet = self.WorkBook.copy_worksheet(self.sheet)\n",
    "            new_sheet.title = f'{self.WorkBook.sheetnames[self.passage]}(第{x + 1}页)'\n",
    "            self.all_sheet_names.append(new_sheet.title)\n",
    "\n",
    "        self.WorkBook.remove(self.sheet)\n",
    "        dirlist = self.Dataframe['新的数据'].shape[0]\n",
    "        # with ThreadPoolExecutor(max_workers=20) as executor:\n",
    "\n",
    "        for index in range(dirlist):\n",
    "            # print('行号:', index)\n",
    "            self.__write_excel__(index)\n",
    "\n",
    "    def __write_excel__(self, index):\n",
    "\n",
    "        # [[1, [1, '9', 12]], [4, [1, '9', 13]], [2, [1, '9', 14]]]\n",
    "        print(self.Dataframe['新的数据'].iloc[index])\n",
    "        for data in self.Dataframe['新的数据'].iloc[index]:\n",
    "            value, item = data\n",
    "            Page1, row, col = item\n",
    "            # 1 、写入部位\n",
    "            firstname = self.all_sheet_names[Page1 - 1]\n",
    "            DirSheet = self.WorkBook[firstname]\n",
    "            DirSheet[self.Dataframe['行号'].iloc[index]] = self.Dataframe['检验批部位'].iloc[index]\n",
    "            # 2 、写入检查部位\n",
    "            DirSheet.cell(row=int(row), column=int(col + 4)).value = value\n",
    "            error_col = col + Page1 * 10\n",
    "\n",
    "            # 3 、插入错误图片\n",
    "            if self.Dataframe['错误数据所在的位置'].iloc[index]:\n",
    "                if error_col in self.Dataframe['错误数据所在的位置'].iloc[index]:\n",
    "                    print('错误列', error_col)\n",
    "                    print('有错误:', self.Dataframe['错误数据所在的位置'].iloc[index])\n",
    "                    # ProjectInFoErrorRelex.__inquire__image__(DirSheet, row=row, col=error_col)\n",
    "\n",
    "            # print(f\"数据{self.Dataframe['新的数据'].iloc[index]};\"\n",
    "            #       f'value:{value};'\n",
    "            #       f'Page:{Page1};'\n",
    "            #       f'开始写入的{firstname};'\n",
    "            #       f'row:{row},col{col}')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 148,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.792716Z",
     "start_time": "2023-12-20T13:11:00.777237Z"
    }
   },
   "outputs": [],
   "source": [
    "from pandas import Series\n",
    "\n",
    "\n",
    "class ProjectInFoDataFrame(ProjectInformationBase):\n",
    "\n",
    "    def __init__(self):\n",
    "        super().__init__()\n",
    "        excel_path = r'./Templates/模板/模板数据.xlsx'\n",
    "        self.excel_path = excel_path\n",
    "\n",
    "        self.Dataframe = pd.read_excel(self.excel_path, header=0)\n",
    "        # print(self.Dataframe)\n",
    "        self.Dataframe['检验批部位'] = self.config['检验批部位']\n",
    "\n",
    "        self.Dataframe['是否需要'] = self.Dataframe['规则1'].apply(\n",
    "            lambda series: eval(series)(ProjectInformationBase().config))\n",
    "\n",
    "        self.Dataframe['检查数量'] = self.Dataframe['规则2'].apply(\n",
    "            lambda series: ProjectInformationWood().check_number_func[series])\n",
    "\n",
    "        self.Dataframe['范围'] = self.Dataframe['范围'].apply(lambda x: eval(x))\n",
    "\n",
    "        self.Dataframe['所有的数据'] = self.Dataframe[['范围', '检查数量']].apply(\n",
    "            lambda x: ProjectInFoErrorRelex(number=x['检查数量'], OldRange=x['范围'], accuracy=90).rowdata, axis=1)\n",
    "\n",
    "        self.Dataframe['数据'] = self.Dataframe['所有的数据'].apply(lambda x: x['数据'])\n",
    "\n",
    "        self.Dataframe['错误数据所在的位置'] = self.Dataframe['所有的数据'].apply(lambda x: x['错误数据所在的位置'])\n",
    "\n",
    "        self.Dataframe['起始列号'] = self.Dataframe['行号'].apply(lambda x: Col2Int(re.findall('[A-Z]+', x)[0]))\n",
    "\n",
    "        self.Dataframe['起始行号'] = self.Dataframe['行号'].apply(lambda x: re.findall('[0-9]+', x)[0])\n",
    "\n",
    "        self.Dataframe['新的数据'] = self.Dataframe[['数据', '起始列号', '起始行号']].apply(\n",
    "            lambda Series: [[value,\n",
    "                             [math.ceil((key + 1) / 10),\n",
    "                              Series['起始行号'],\n",
    "                              Series['起始列号'] + key - (math.ceil((key + 1) / 10) - 1) * 10]]\n",
    "                            for key, value in enumerate(Series['数据'])], axis=1)\n",
    "        \n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 149,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.817823Z",
     "start_time": "2023-12-20T13:11:00.781265Z"
    }
   },
   "outputs": [],
   "source": [
    "dirdataframe = ProjectInFoDataFrame().Dataframe\n",
    "pasages = dirdataframe['页码'].unique()\n",
    "# for pasge in pasages:\n",
    "pasge=1\n",
    "newdataframe = dirdataframe[(dirdataframe['页码'] == pasge) & (dirdataframe['是否需要'] == True)]\n",
    "max_pasge = math.ceil(newdataframe['检查数量'].max() / 10)\n",
    "# print(newdataframe)\n",
    "# newdataframe.to_csv('1.csv')\n",
    "# print(newdataframe.index.to_list())\n",
    "# MuBan(Dataframe=newdataframe, max_pasge=max_pasge, passage=pasge)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 150,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.884374Z",
     "start_time": "2023-12-20T13:11:00.823593Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "    页码   行号       范围                                                规则1  是否需要  \\\n0    1   L8   [1, 4]  lambda config:True if judge_part(items=['梁'],p...  True   \n1    1   L9   [1, 4]  lambda config:True if judge_part(items=['板'],p...  True   \n3    1  L11   [0, 3]  lambda config:True if judge_part(items=['设备', ...  True   \n4    1  L12   [0, 5]  lambda config:True if judge_part(items=['插筋', ...  True   \n5    1  L13  [0, 10]  lambda config:True if judge_part(items=['插筋', ...  True   \n10   1  L18   [0, 5]                        lambda config: config['常规']  True   \n11   1  L19   [0, 5]                        lambda config: config['常规']  True   \n12   1  L20  [0, 10]                        lambda config: config['常规']  True   \n13   1  L21  [-5, 5]  lambda config:True if judge_part(items=['柱','墙...  True   \n14   1  L22  [-5, 5]  lambda config:True if judge_part(items=['楼梯','...  True   \n16   1  L24  [0, 10]                        lambda config: config['常规']  True   \n\n       规则2  检查数量                                                 数据  备注  \\\n0    梁检查数量     2                                          [4, 4, 2] NaN   \n1    板检查数量     3                                          [4, 2, 1] NaN   \n3    板检查数量     3                                          [1, 0, 3] NaN   \n4    柱检查数量     2                                          [0, 5, 5] NaN   \n5    柱检查数量     2                                          [4, 7, 7] NaN   \n10    构件总数    29  [0, 2, 2, 3, 1, 3, 1, 5, 4, 3, 5, 2, 0, 5, 3, ... NaN   \n11    构件总数    29  [4, 4, 1, 3, 1, 8, 2, 5, 4, 5, 3, 4, 5, 4, 0, ... NaN   \n12    构件总数    29  [0, 2, 1, 5, 9, 9, 7, 7, 3, 7, 8, 5, 9, 8, 3, ... NaN   \n13    构件总数    29  [4, 4, -5, 1, -4, -1, 4, -5, -2, -5, 3, -2, 5,... NaN   \n14  楼梯检查数量     3                                          [1, 2, 2] NaN   \n16    构件总数    29  [7, 9, 2, 9, 6, 10, 10, 7, 0, 8, 10, 10, 5, 10... NaN   \n\n                             检验批部位  \\\n0   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n1   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n3   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n4   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n5   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n10  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n11  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n12  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n13  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n14  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n16  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n\n                                                所有的数据 错误数据所在的位置  起始列号 起始行号  \\\n0                   {'错误数据所在的位置': 0, '数据': [4, 4, 2]}         0    12    8   \n1                   {'错误数据所在的位置': 0, '数据': [4, 2, 1]}         0    12    9   \n3                   {'错误数据所在的位置': 0, '数据': [1, 0, 3]}         0    12   11   \n4                   {'错误数据所在的位置': 0, '数据': [0, 5, 5]}         0    12   12   \n5                   {'错误数据所在的位置': 0, '数据': [4, 7, 7]}         0    12   13   \n10  {'错误数据所在的位置': [15, 25], '数据': [0, 2, 2, 3, 1, ...  [15, 25]    12   18   \n11  {'错误数据所在的位置': [5, 25], '数据': [4, 4, 1, 3, 1, 8...   [5, 25]    12   19   \n12  {'错误数据所在的位置': 0, '数据': [0, 2, 1, 5, 9, 9, 7, 7...         0    12   20   \n13  {'错误数据所在的位置': [15], '数据': [4, 4, -5, 1, -4, -1...      [15]    12   21   \n14                  {'错误数据所在的位置': 0, '数据': [1, 2, 2]}         0    12   22   \n16  {'错误数据所在的位置': 0, '数据': [7, 9, 2, 9, 6, 10, 10,...         0    12   24   \n\n                                                 新的数据  \n0   [[4, [1, 8, 12]], [4, [1, 8, 13]], [2, [1, 8, ...  \n1   [[4, [1, 9, 12]], [2, [1, 9, 13]], [1, [1, 9, ...  \n3   [[1, [1, 11, 12]], [0, [1, 11, 13]], [3, [1, 1...  \n4   [[0, [1, 12, 12]], [5, [1, 12, 13]], [5, [1, 1...  \n5   [[4, [1, 13, 12]], [7, [1, 13, 13]], [7, [1, 1...  \n10  [[0, [1, 18, 12]], [2, [1, 18, 13]], [2, [1, 1...  \n11  [[4, [1, 19, 12]], [4, [1, 19, 13]], [1, [1, 1...  \n12  [[0, [1, 20, 12]], [2, [1, 20, 13]], [1, [1, 2...  \n13  [[4, [1, 21, 12]], [4, [1, 21, 13]], [-5, [1, ...  \n14  [[1, [1, 22, 12]], [2, [1, 22, 13]], [2, [1, 2...  \n16  [[7, [1, 24, 12]], [9, [1, 24, 13]], [2, [1, 2...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>页码</th>\n      <th>行号</th>\n      <th>范围</th>\n      <th>规则1</th>\n      <th>是否需要</th>\n      <th>规则2</th>\n      <th>检查数量</th>\n      <th>数据</th>\n      <th>备注</th>\n      <th>检验批部位</th>\n      <th>所有的数据</th>\n      <th>错误数据所在的位置</th>\n      <th>起始列号</th>\n      <th>起始行号</th>\n      <th>新的数据</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>L8</td>\n      <td>[1, 4]</td>\n      <td>lambda config:True if judge_part(items=['梁'],p...</td>\n      <td>True</td>\n      <td>梁检查数量</td>\n      <td>2</td>\n      <td>[4, 4, 2]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 4, 2]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>8</td>\n      <td>[[4, [1, 8, 12]], [4, [1, 8, 13]], [2, [1, 8, ...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>L9</td>\n      <td>[1, 4]</td>\n      <td>lambda config:True if judge_part(items=['板'],p...</td>\n      <td>True</td>\n      <td>板检查数量</td>\n      <td>3</td>\n      <td>[4, 2, 1]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 2, 1]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>9</td>\n      <td>[[4, [1, 9, 12]], [2, [1, 9, 13]], [1, [1, 9, ...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>L11</td>\n      <td>[0, 3]</td>\n      <td>lambda config:True if judge_part(items=['设备', ...</td>\n      <td>True</td>\n      <td>板检查数量</td>\n      <td>3</td>\n      <td>[1, 0, 3]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [1, 0, 3]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>11</td>\n      <td>[[1, [1, 11, 12]], [0, [1, 11, 13]], [3, [1, 1...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>L12</td>\n      <td>[0, 5]</td>\n      <td>lambda config:True if judge_part(items=['插筋', ...</td>\n      <td>True</td>\n      <td>柱检查数量</td>\n      <td>2</td>\n      <td>[0, 5, 5]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [0, 5, 5]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>12</td>\n      <td>[[0, [1, 12, 12]], [5, [1, 12, 13]], [5, [1, 1...</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>1</td>\n      <td>L13</td>\n      <td>[0, 10]</td>\n      <td>lambda config:True if judge_part(items=['插筋', ...</td>\n      <td>True</td>\n      <td>柱检查数量</td>\n      <td>2</td>\n      <td>[4, 7, 7]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 7, 7]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>13</td>\n      <td>[[4, [1, 13, 12]], [7, [1, 13, 13]], [7, [1, 1...</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>1</td>\n      <td>L18</td>\n      <td>[0, 5]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[0, 2, 2, 3, 1, 3, 1, 5, 4, 3, 5, 2, 0, 5, 3, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [15, 25], '数据': [0, 2, 2, 3, 1, ...</td>\n      <td>[15, 25]</td>\n      <td>12</td>\n      <td>18</td>\n      <td>[[0, [1, 18, 12]], [2, [1, 18, 13]], [2, [1, 1...</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>1</td>\n      <td>L19</td>\n      <td>[0, 5]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[4, 4, 1, 3, 1, 8, 2, 5, 4, 5, 3, 4, 5, 4, 0, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [5, 25], '数据': [4, 4, 1, 3, 1, 8...</td>\n      <td>[5, 25]</td>\n      <td>12</td>\n      <td>19</td>\n      <td>[[4, [1, 19, 12]], [4, [1, 19, 13]], [1, [1, 1...</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>1</td>\n      <td>L20</td>\n      <td>[0, 10]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[0, 2, 1, 5, 9, 9, 7, 7, 3, 7, 8, 5, 9, 8, 3, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [0, 2, 1, 5, 9, 9, 7, 7...</td>\n      <td>0</td>\n      <td>12</td>\n      <td>20</td>\n      <td>[[0, [1, 20, 12]], [2, [1, 20, 13]], [1, [1, 2...</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>1</td>\n      <td>L21</td>\n      <td>[-5, 5]</td>\n      <td>lambda config:True if judge_part(items=['柱','墙...</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[4, 4, -5, 1, -4, -1, 4, -5, -2, -5, 3, -2, 5,...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [15], '数据': [4, 4, -5, 1, -4, -1...</td>\n      <td>[15]</td>\n      <td>12</td>\n      <td>21</td>\n      <td>[[4, [1, 21, 12]], [4, [1, 21, 13]], [-5, [1, ...</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>1</td>\n      <td>L22</td>\n      <td>[-5, 5]</td>\n      <td>lambda config:True if judge_part(items=['楼梯','...</td>\n      <td>True</td>\n      <td>楼梯检查数量</td>\n      <td>3</td>\n      <td>[1, 2, 2]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [1, 2, 2]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>22</td>\n      <td>[[1, [1, 22, 12]], [2, [1, 22, 13]], [2, [1, 2...</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>1</td>\n      <td>L24</td>\n      <td>[0, 10]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[7, 9, 2, 9, 6, 10, 10, 7, 0, 8, 10, 10, 5, 10...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [7, 9, 2, 9, 6, 10, 10,...</td>\n      <td>0</td>\n      <td>12</td>\n      <td>24</td>\n      <td>[[7, [1, 24, 12]], [9, [1, 24, 13]], [2, [1, 2...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 150,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "newdataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 151,
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:00.890449Z",
     "start_time": "2023-12-20T13:11:00.884883Z"
    }
   },
   "outputs": [],
   "source": [
    "def __boolFlase__(Series1:list,Series2:list):\n",
    "    \"\"\"_summary_\n",
    "    Args:\n",
    "        Series1 (list): 所有的数据\n",
    "        Series2 (list): 错误数据所在的位置\n",
    "    \"\"\"    \n",
    "    if type(Series2) is list:\n",
    "        for key,value in enumerate(Series2):\n",
    "            if key in Series2:\n",
    "                Series1[key].append(False)\n",
    "            else:\n",
    "                Series1[key].append(True)           \n",
    "        return Series1\n",
    "    else:\n",
    "        for item in Series1:\n",
    "            item.append(True)\n",
    "        return Series1\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 163,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-12-20T13:19:15.176640Z",
     "start_time": "2023-12-20T13:19:15.169568Z"
    }
   },
   "outputs": [],
   "source": [
    "fillydataframe = newdataframe.copy()\n",
    "fillydataframe['最终数据']=newdataframe[['新的数据','错误数据所在的位置']].apply(lambda x:__boolFlase__(Series1=x['新的数据'],Series2=x['错误数据所在的位置']),axis=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-12-20T13:19:21.155251Z",
     "start_time": "2023-12-20T13:19:21.127006Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "0     [[4, [1, 8, 12], True, True], [4, [1, 8, 13], ...\n1     [[4, [1, 9, 12], True, True], [2, [1, 9, 13], ...\n3     [[1, [1, 11, 12], True, True], [0, [1, 11, 13]...\n4     [[0, [1, 12, 12], True, True], [5, [1, 12, 13]...\n5     [[4, [1, 13, 12], True, True], [7, [1, 13, 13]...\n10    [[0, [1, 18, 12], True, True], [2, [1, 18, 13]...\n11    [[4, [1, 19, 12], True, True], [4, [1, 19, 13]...\n12    [[0, [1, 20, 12], True, True], [2, [1, 20, 13]...\n13    [[4, [1, 21, 12], True, True], [4, [1, 21, 13]...\n14    [[1, [1, 22, 12], True, True], [2, [1, 22, 13]...\n16    [[7, [1, 24, 12], True, True], [9, [1, 24, 13]...\nName: 最终数据, dtype: object"
     },
     "execution_count": 164,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fillydataframe['最终数据']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 156,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2023-12-20T13:11:08.568038Z",
     "start_time": "2023-12-20T13:11:08.448153Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "    页码   行号       范围                                                规则1  是否需要  \\\n0    1   L8   [1, 4]  lambda config:True if judge_part(items=['梁'],p...  True   \n1    1   L9   [1, 4]  lambda config:True if judge_part(items=['板'],p...  True   \n3    1  L11   [0, 3]  lambda config:True if judge_part(items=['设备', ...  True   \n4    1  L12   [0, 5]  lambda config:True if judge_part(items=['插筋', ...  True   \n5    1  L13  [0, 10]  lambda config:True if judge_part(items=['插筋', ...  True   \n10   1  L18   [0, 5]                        lambda config: config['常规']  True   \n11   1  L19   [0, 5]                        lambda config: config['常规']  True   \n12   1  L20  [0, 10]                        lambda config: config['常规']  True   \n13   1  L21  [-5, 5]  lambda config:True if judge_part(items=['柱','墙...  True   \n14   1  L22  [-5, 5]  lambda config:True if judge_part(items=['楼梯','...  True   \n16   1  L24  [0, 10]                        lambda config: config['常规']  True   \n\n       规则2  检查数量                                                 数据  备注  \\\n0    梁检查数量     2                                          [4, 4, 2] NaN   \n1    板检查数量     3                                          [4, 2, 1] NaN   \n3    板检查数量     3                                          [1, 0, 3] NaN   \n4    柱检查数量     2                                          [0, 5, 5] NaN   \n5    柱检查数量     2                                          [4, 7, 7] NaN   \n10    构件总数    29  [0, 2, 2, 3, 1, 3, 1, 5, 4, 3, 5, 2, 0, 5, 3, ... NaN   \n11    构件总数    29  [4, 4, 1, 3, 1, 8, 2, 5, 4, 5, 3, 4, 5, 4, 0, ... NaN   \n12    构件总数    29  [0, 2, 1, 5, 9, 9, 7, 7, 3, 7, 8, 5, 9, 8, 3, ... NaN   \n13    构件总数    29  [4, 4, -5, 1, -4, -1, 4, -5, -2, -5, 3, -2, 5,... NaN   \n14  楼梯检查数量     3                                          [1, 2, 2] NaN   \n16    构件总数    29  [7, 9, 2, 9, 6, 10, 10, 7, 0, 8, 10, 10, 5, 10... NaN   \n\n                             检验批部位  \\\n0   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n1   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n3   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n4   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n5   D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n10  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n11  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n12  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n13  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n14  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n16  D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯   \n\n                                                所有的数据 错误数据所在的位置  起始列号 起始行号  \\\n0                   {'错误数据所在的位置': 0, '数据': [4, 4, 2]}         0    12    8   \n1                   {'错误数据所在的位置': 0, '数据': [4, 2, 1]}         0    12    9   \n3                   {'错误数据所在的位置': 0, '数据': [1, 0, 3]}         0    12   11   \n4                   {'错误数据所在的位置': 0, '数据': [0, 5, 5]}         0    12   12   \n5                   {'错误数据所在的位置': 0, '数据': [4, 7, 7]}         0    12   13   \n10  {'错误数据所在的位置': [15, 25], '数据': [0, 2, 2, 3, 1, ...  [15, 25]    12   18   \n11  {'错误数据所在的位置': [5, 25], '数据': [4, 4, 1, 3, 1, 8...   [5, 25]    12   19   \n12  {'错误数据所在的位置': 0, '数据': [0, 2, 1, 5, 9, 9, 7, 7...         0    12   20   \n13  {'错误数据所在的位置': [15], '数据': [4, 4, -5, 1, -4, -1...      [15]    12   21   \n14                  {'错误数据所在的位置': 0, '数据': [1, 2, 2]}         0    12   22   \n16  {'错误数据所在的位置': 0, '数据': [7, 9, 2, 9, 6, 10, 10,...         0    12   24   \n\n                                                 新的数据  \\\n0   [[4, [1, 8, 12], True], [4, [1, 8, 13], True],...   \n1   [[4, [1, 9, 12], True], [2, [1, 9, 13], True],...   \n3   [[1, [1, 11, 12], True], [0, [1, 11, 13], True...   \n4   [[0, [1, 12, 12], True], [5, [1, 12, 13], True...   \n5   [[4, [1, 13, 12], True], [7, [1, 13, 13], True...   \n10  [[0, [1, 18, 12], True], [2, [1, 18, 13], True...   \n11  [[4, [1, 19, 12], True], [4, [1, 19, 13], True...   \n12  [[0, [1, 20, 12], True], [2, [1, 20, 13], True...   \n13  [[4, [1, 21, 12], True], [4, [1, 21, 13]], [-5...   \n14  [[1, [1, 22, 12], True], [2, [1, 22, 13], True...   \n16  [[7, [1, 24, 12], True], [9, [1, 24, 13], True...   \n\n                                                 最终数据  \n0   [[4, [1, 8, 12], True], [4, [1, 8, 13], True],...  \n1   [[4, [1, 9, 12], True], [2, [1, 9, 13], True],...  \n3   [[1, [1, 11, 12], True], [0, [1, 11, 13], True...  \n4   [[0, [1, 12, 12], True], [5, [1, 12, 13], True...  \n5   [[4, [1, 13, 12], True], [7, [1, 13, 13], True...  \n10  [[0, [1, 18, 12], True], [2, [1, 18, 13], True...  \n11  [[4, [1, 19, 12], True], [4, [1, 19, 13], True...  \n12  [[0, [1, 20, 12], True], [2, [1, 20, 13], True...  \n13  [[4, [1, 21, 12], True], [4, [1, 21, 13]], [-5...  \n14  [[1, [1, 22, 12], True], [2, [1, 22, 13], True...  \n16  [[7, [1, 24, 12], True], [9, [1, 24, 13], True...  ",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>页码</th>\n      <th>行号</th>\n      <th>范围</th>\n      <th>规则1</th>\n      <th>是否需要</th>\n      <th>规则2</th>\n      <th>检查数量</th>\n      <th>数据</th>\n      <th>备注</th>\n      <th>检验批部位</th>\n      <th>所有的数据</th>\n      <th>错误数据所在的位置</th>\n      <th>起始列号</th>\n      <th>起始行号</th>\n      <th>新的数据</th>\n      <th>最终数据</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>1</td>\n      <td>L8</td>\n      <td>[1, 4]</td>\n      <td>lambda config:True if judge_part(items=['梁'],p...</td>\n      <td>True</td>\n      <td>梁检查数量</td>\n      <td>2</td>\n      <td>[4, 4, 2]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 4, 2]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>8</td>\n      <td>[[4, [1, 8, 12], True], [4, [1, 8, 13], True],...</td>\n      <td>[[4, [1, 8, 12], True], [4, [1, 8, 13], True],...</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>1</td>\n      <td>L9</td>\n      <td>[1, 4]</td>\n      <td>lambda config:True if judge_part(items=['板'],p...</td>\n      <td>True</td>\n      <td>板检查数量</td>\n      <td>3</td>\n      <td>[4, 2, 1]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 2, 1]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>9</td>\n      <td>[[4, [1, 9, 12], True], [2, [1, 9, 13], True],...</td>\n      <td>[[4, [1, 9, 12], True], [2, [1, 9, 13], True],...</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>1</td>\n      <td>L11</td>\n      <td>[0, 3]</td>\n      <td>lambda config:True if judge_part(items=['设备', ...</td>\n      <td>True</td>\n      <td>板检查数量</td>\n      <td>3</td>\n      <td>[1, 0, 3]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [1, 0, 3]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>11</td>\n      <td>[[1, [1, 11, 12], True], [0, [1, 11, 13], True...</td>\n      <td>[[1, [1, 11, 12], True], [0, [1, 11, 13], True...</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>1</td>\n      <td>L12</td>\n      <td>[0, 5]</td>\n      <td>lambda config:True if judge_part(items=['插筋', ...</td>\n      <td>True</td>\n      <td>柱检查数量</td>\n      <td>2</td>\n      <td>[0, 5, 5]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [0, 5, 5]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>12</td>\n      <td>[[0, [1, 12, 12], True], [5, [1, 12, 13], True...</td>\n      <td>[[0, [1, 12, 12], True], [5, [1, 12, 13], True...</td>\n    </tr>\n    <tr>\n      <th>5</th>\n      <td>1</td>\n      <td>L13</td>\n      <td>[0, 10]</td>\n      <td>lambda config:True if judge_part(items=['插筋', ...</td>\n      <td>True</td>\n      <td>柱检查数量</td>\n      <td>2</td>\n      <td>[4, 7, 7]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [4, 7, 7]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>13</td>\n      <td>[[4, [1, 13, 12], True], [7, [1, 13, 13], True...</td>\n      <td>[[4, [1, 13, 12], True], [7, [1, 13, 13], True...</td>\n    </tr>\n    <tr>\n      <th>10</th>\n      <td>1</td>\n      <td>L18</td>\n      <td>[0, 5]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[0, 2, 2, 3, 1, 3, 1, 5, 4, 3, 5, 2, 0, 5, 3, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [15, 25], '数据': [0, 2, 2, 3, 1, ...</td>\n      <td>[15, 25]</td>\n      <td>12</td>\n      <td>18</td>\n      <td>[[0, [1, 18, 12], True], [2, [1, 18, 13], True...</td>\n      <td>[[0, [1, 18, 12], True], [2, [1, 18, 13], True...</td>\n    </tr>\n    <tr>\n      <th>11</th>\n      <td>1</td>\n      <td>L19</td>\n      <td>[0, 5]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[4, 4, 1, 3, 1, 8, 2, 5, 4, 5, 3, 4, 5, 4, 0, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [5, 25], '数据': [4, 4, 1, 3, 1, 8...</td>\n      <td>[5, 25]</td>\n      <td>12</td>\n      <td>19</td>\n      <td>[[4, [1, 19, 12], True], [4, [1, 19, 13], True...</td>\n      <td>[[4, [1, 19, 12], True], [4, [1, 19, 13], True...</td>\n    </tr>\n    <tr>\n      <th>12</th>\n      <td>1</td>\n      <td>L20</td>\n      <td>[0, 10]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[0, 2, 1, 5, 9, 9, 7, 7, 3, 7, 8, 5, 9, 8, 3, ...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [0, 2, 1, 5, 9, 9, 7, 7...</td>\n      <td>0</td>\n      <td>12</td>\n      <td>20</td>\n      <td>[[0, [1, 20, 12], True], [2, [1, 20, 13], True...</td>\n      <td>[[0, [1, 20, 12], True], [2, [1, 20, 13], True...</td>\n    </tr>\n    <tr>\n      <th>13</th>\n      <td>1</td>\n      <td>L21</td>\n      <td>[-5, 5]</td>\n      <td>lambda config:True if judge_part(items=['柱','墙...</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[4, 4, -5, 1, -4, -1, 4, -5, -2, -5, 3, -2, 5,...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': [15], '数据': [4, 4, -5, 1, -4, -1...</td>\n      <td>[15]</td>\n      <td>12</td>\n      <td>21</td>\n      <td>[[4, [1, 21, 12], True], [4, [1, 21, 13]], [-5...</td>\n      <td>[[4, [1, 21, 12], True], [4, [1, 21, 13]], [-5...</td>\n    </tr>\n    <tr>\n      <th>14</th>\n      <td>1</td>\n      <td>L22</td>\n      <td>[-5, 5]</td>\n      <td>lambda config:True if judge_part(items=['楼梯','...</td>\n      <td>True</td>\n      <td>楼梯检查数量</td>\n      <td>3</td>\n      <td>[1, 2, 2]</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [1, 2, 2]}</td>\n      <td>0</td>\n      <td>12</td>\n      <td>22</td>\n      <td>[[1, [1, 22, 12], True], [2, [1, 22, 13], True...</td>\n      <td>[[1, [1, 22, 12], True], [2, [1, 22, 13], True...</td>\n    </tr>\n    <tr>\n      <th>16</th>\n      <td>1</td>\n      <td>L24</td>\n      <td>[0, 10]</td>\n      <td>lambda config: config['常规']</td>\n      <td>True</td>\n      <td>构件总数</td>\n      <td>29</td>\n      <td>[7, 9, 2, 9, 6, 10, 10, 7, 0, 8, 10, 10, 5, 10...</td>\n      <td>NaN</td>\n      <td>D11#楼B-14~B-28/B-A~B-L轴三层结构梁板梯</td>\n      <td>{'错误数据所在的位置': 0, '数据': [7, 9, 2, 9, 6, 10, 10,...</td>\n      <td>0</td>\n      <td>12</td>\n      <td>24</td>\n      <td>[[7, [1, 24, 12], True], [9, [1, 24, 13], True...</td>\n      <td>[[7, [1, 24, 12], True], [9, [1, 24, 13], True...</td>\n    </tr>\n  </tbody>\n</table>\n</div>"
     },
     "execution_count": 156,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "fillydataframe"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 157,
   "outputs": [],
   "source": [
    "li=[0, 2, 2, 3, 1, 3, 1, 5, 4, 3, 5, 2, 0, 5, 3]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:13:16.111129Z",
     "start_time": "2023-12-20T13:13:16.087882Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 158,
   "outputs": [],
   "source": [
    "S=pd.Series(li)"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:13:26.181042Z",
     "start_time": "2023-12-20T13:13:26.158977Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 162,
   "outputs": [
    {
     "data": {
      "text/plain": "1    2\n2    2\ndtype: int64"
     },
     "execution_count": 162,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "S[[1,2]]"
   ],
   "metadata": {
    "collapsed": false,
    "ExecuteTime": {
     "end_time": "2023-12-20T13:15:42.534595Z",
     "start_time": "2023-12-20T13:15:42.526090Z"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.16"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
